From: Florian Müllner Date: Wed, 27 Jul 2022 02:38:21 +0000 (+0200) Subject: status/location: Remove submenu X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~461^2^2~209 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=dc4ed1d7d273c8fd7d2d8204170a835b6336d6fd;p=gnome-shell.git status/location: Remove submenu Location services aren't expected to change frequently: They are either disabled globally, or permissions are granted on a per-app basis. This is less of a concern while the setting is exposed in a small submenu, but as we moving to quick settings, it does not deserve the prominence of a quick toggle. Just the top bar icon and Settings' privacy panel should be enough. Part-of: --- diff --git a/js/ui/status/location.js b/js/ui/status/location.js index aa849d64a..52f374fb2 100644 --- a/js/ui/status/location.js +++ b/js/ui/status/location.js @@ -4,9 +4,7 @@ const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi; const Dialog = imports.ui.dialog; -const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; -const PopupMenu = imports.ui.popupMenu; const ModalDialog = imports.ui.modalDialog; const PermissionStore = imports.misc.permissionStore; @@ -220,44 +218,6 @@ class Indicator extends PanelMenu.SystemIndicator { this._indicator, 'visible', GObject.BindingFlags.SYNC_CREATE); - - this._item = new PopupMenu.PopupSubMenuMenuItem('', true); - this._item.icon.icon_name = 'find-location-symbolic'; - this._agent.bind_property('in-use', - this._item, - 'visible', - GObject.BindingFlags.SYNC_CREATE); - - this._item.label.text = _('Location Enabled'); - this._onOffAction = this._item.menu.addAction(_('Disable'), - () => (this._agent.enabled = !this._agent.enabled)); - this._item.menu.addSettingsAction(_('Privacy Settings'), 'gnome-location-panel.desktop'); - - this.menu.addMenuItem(this._item); - - this._agent.connectObject( - 'notify::enabled', () => this._sync(), - 'notify::in-use', () => this._sync(), this); - - Main.sessionMode.connect('updated', this._onSessionUpdated.bind(this)); - this._onSessionUpdated(); - } - - _onSessionUpdated() { - let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter; - this.menu.setSensitive(sensitive); - } - - _sync() { - if (this._agent.enabled) { - this._item.label.text = this._indicator.visible - ? _('Location In Use') - : _('Location Enabled'); - this._onOffAction.label.text = _('Disable'); - } else { - this._item.label.text = _('Location Disabled'); - this._onOffAction.label.text = _('Enable'); - } } });